package com.ijecorp.media.audio;

public abstract class AudioFormat {
	private static final int FORMAT = 1000;
	public static final int WAVE = FORMAT + 1;
	public static final int OGG = FORMAT + 2;
	public static final int FLAC = FORMAT + 3;
	public static final int AIFF = FORMAT + 4;
	public static final int RAW = FORMAT + 5;
	public static final int AU = FORMAT + 6;
	//: Open file formats
	public static final int GSM = FORMAT + 7;
	public static final int DCT = FORMAT + 8;
	public static final int VOX = FORMAT + 9;
	public static final int AAC = FORMAT + 10;	
	public static final int MPEG4 = FORMAT + 11;
	//: Proprietary formats
	public static final int MP3 = FORMAT + 12;
	public static final int WMA = FORMAT + 13;
	public static final int ATRAC = FORMAT + 14;
	public static final int RA = FORMAT + 15;
	public static final int RAM = FORMAT + 16;
	public static final int DSS = FORMAT + 17;
	public static final int MSV = FORMAT + 18;
	public static final int DVF = FORMAT + 19;
	public static final int M4P = FORMAT + 20;

	//: Free and open file formats
	private static final String WAVE_FROAMT = "WAV";
	private static final String OGG_FORMAT = "OGG";
	private static final String FLAC_FORMAT = "FLAC";
	private static final String AIFF_FORMAT = "AIFF";
	private static final String RAW_FORMAT = "RAW";
	private static final String AU_FORAMT = "AU";
	//: Open file formats
	private static final String GSM_FORMAT = "GSM";
	private static final String DCT_FORMAT = "DCT";
	private static final String VOX_FORMAT = "VOX";
	private static final String AAC_FORAMT = "AAC";	
	private static final String MPEG4_FORMAT = "MPEG4";
	//: Proprietary formats
	private static final String MP3_FORMAT = "MP3";
	private static final String WMA_FORMAT = "WMA";
	private static final String ATRAC_FORAMT = "ATRAC";
	private static final String RA_FORMAT = "RA";
	private static final String RAM_FORMAT = "RAM";
	private static final String DSS_FORMAT = "DSS";
	private static final String MSV_FORMAT = "MSV";
	private static final String DVF_FORMAT = "DVF";
	private static final String M4P_FORMAT = "M4P";
	
	public static final String FORMATS[] = {
		"UNKNOW",
		WAVE_FROAMT ,
		OGG_FORMAT ,
		FLAC_FORMAT ,
		AIFF_FORMAT ,
		RAW_FORMAT ,
		AU_FORAMT ,
			
		GSM_FORMAT ,
		DCT_FORMAT ,
		VOX_FORMAT ,
		AAC_FORAMT ,	
		MPEG4_FORMAT ,
			
		MP3_FORMAT ,
		WMA_FORMAT ,
		ATRAC_FORAMT ,
		RA_FORMAT ,
		RAM_FORMAT ,
		DSS_FORMAT ,
		MSV_FORMAT ,
		DVF_FORMAT ,
		M4P_FORMAT ,	
	};
	
	public static String getAudioFormat(int fmt){
		if(fmt< FORMAT || fmt >= FORMAT + FORMATS.length){
			throw new RuntimeException("Not support format value = " + fmt);
		}
		return  FORMATS[fmt-FORMAT];
	}
	
//	public static void main(String args[]){
//		for(int i = FORMAT ; i <= FORMAT+ FORMATS.length ; i++){
//			System.out.println(getAudioFormat(i));
//		}
//	}
}
